<?php

/**
 * oRs
 *
 * @version 3.0
 * @copyright 2009 Ron Planken
 * @class: item
 * @description: item stuff
 */

class item {

	public $_name; //just the name
	public $_id; //ingame id, wowhead id, item id..
	public $_slot; //feet, head, ring..
	public $_quality; //epic, normal..
	public $_icon; //the INV_ITEM_LOL icon name
	public $_type; // Armor, general, food..
		
	
	function __construct($system) {
		$this->_name = "None";
		$this->_id = 0;
		$this->_slot = 0;
		$this->_quality = 0;
		$this->_icon = "INV_Misc_QuestionMark";
		$this->_type = 0;
		
		$this->_system = $system;
	}
	
	private function wowHeadGet($name){
		
		$this->_name = $name;
		
		$url = "http://www.wowhead.com/?item=".urlencode(addslashes($this->_name))."&xml";
	
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($cURL, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11');
		curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_HEADER, 0);
		
		$strPage = curl_exec($ch);
	
		$xml = simplexml_load_string($strPage);
		
		curl_close($ch);
	
	}
	
	private function parseXML($xml)
	{
		$this->_id 		= 	secure_int($xml_data->item['id']);
		$this->_slot 	= 	secure_int($xml_data->item->inventorySlot['id']);
		$this->_quality =	secure_int($xml_data->item->quality['id']);
		$this->_icon 	= 	secure_int($xml_data->characterInfo->character['level']);
		$this->_type 	= 	secure_int($xml_data->item['icon']);
	}
	
	private function localDatabaseGet(){
		

	}
	
	public function save() {
		

	}
	
	public function load() {
		

	}
}
?>